package org.llc.gof.structure.proxy.basic;

/**
 * 代理类实现被代理的接口
 * @author lilichai
 * @date 2018-9-09
 */
public class Proxy implements Subject {
	
    private Subject subject;

	public Proxy(Subject _subject){
		this.subject = _subject;
	}

	@Override
	public void request() {
		this.before();
		this.subject.request();
		this.after();
	}
	
	private void before(){
	    System.out.println( "this is before!" );
	}
	
	private void after(){
	    System.out.println( "this is after！" );
	}
}
